﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using View.Chart;

namespace View
{
    /// <summary>
    /// 曲线界面
    /// </summary>
    public partial class DemoChartForm : DevExpress.XtraEditors.XtraForm
    {
        //默认设备类型
        public string strDefaultDeviceType;
        //默认设备名称
        public string strDefaultDeviceName;
        //曲线类型
        public ChartType_Data CType;

        public bool IsRealTimeChart;

        public DemoChartForm(string strDType,ChartType_Data type)
        {
            InitializeComponent();
            strDefaultDeviceType = strDType;
            MultiPaneChartBase chart = new MultiPaneChartBase();
            switch(type)
            {
                case ChartType_Data.Real:
                    this.Text = "实时曲线";
                    break;
                case ChartType_Data.DAY:
                    this.Text = "日曲线";
                    break;
                case ChartType_Data.MONTH:
                    this.Text = "月曲线";
                    break;
                case ChartType_Data.YEAR:
                    this.Text = "年曲线";
                    break;
                default:
                    break;
            }
            chart.CType = type;
            chart.IniLayout();
            chart.CreateDeviceList(strDefaultDeviceType);
            this.Controls.Add(chart);
            chart.Dock = DockStyle.Fill;
        }

        /// <summary>
        /// 初始化曲线界面
        /// </summary>
        private void IniChartLayout()
        {
            if (!IsRealTimeChart)
            {
            }
        }
    }
}